<template>
	<view class="all" :style="{ 'padding-top': statusBarHeight + 'px' }">
		<!-- 顶部导航 开始 -->
		<uni-nav-bar left-icon="back" title="快讯列表" backgroundColor="#EE515A" color="#ffffff" @clickLeft="handleBack"></uni-nav-bar>
		<!-- 顶部导航 结束 -->
		
		<view class='dynamicBox'>
			<!-- 快讯开始 -->
			<u-row gutter="12" class="padding" style="margin-top: 3px;padding-top: 10px;" v-for="(item, index) in news" :key="index">
				<span style="color: #0084ff; font-size: 14px;">{{item.T}}</span>
				<span style="color: #2C405A; font-size: 14px;">{{item.C}}</span>
				<u-line style="margin-top: 5px;color: #dcdfe6;" />
			</u-row>
			<!-- 快讯结束 -->
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusBarHeight:getApp().globalData.statusBarHeight,//状态栏高度
				news: [],
			};
		},
		methods:{
			//返回上一页
			handleBack(){
				uni.navigateBack({
				    delta: 1
				});
			},
			// 获取新闻
			getKuaixun: function(type) {
				let data = {
					type:type
				}
				this.$Request.post(this.$api.index.getKuaixun,data).then(res => {
					this.news = res.data;
				})
			},
		},
		onLoad(e) {
			let type = e.type
			this.getKuaixun(type)
		}

	}
</script>

<style lang="scss" scoped>
	.dynamicList{
		padding: 15px;
	}
	.newsImg{
		width: 120px;
		height: 78px;
		border-radius: 5px;
		overflow: hidden;
	}
	.dynamicTab{
		padding: 20px 22px 10px;
		border-bottom: 1px solid #090C12;
		.tabItem{
			font-size: 14px;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 18px;
			margin-right: 50px;
			transition: 0.2s all;
			&.active{
				color: #4375E4;
				position: relative;
				font-size: 17px;
				&:after{
					position: absolute;
					content: '';
					bottom: -10px;
					left: 50%;
					margin-left: -8px;
					width: 16px;
					height: 3px;
					background: #4375E4;
					border-radius: 2px;
				
				}
			}
			
		}
	}

</style>
